package mjc.egg;
import mjc.tds.*;
import mjc.type.*;
import mjc.gc.*;
import mjc.compiler.*;
import java.util.*;
import mg.egg.eggc.compiler.libjava.lex.*;
import mg.egg.eggc.compiler.libjava.*;
import mg.egg.eggc.compiler.libjava.problem.IProblem;
import java.util.Vector;
import java.util.List;
import java.util.ArrayList;
public class S_F_MJAVA implements IDstNode {
LEX_MJAVA scanner;
  S_F_MJAVA() {
    }
  S_F_MJAVA(LEX_MJAVA scanner) {
    this.scanner = scanner;
    offset = 0;
    length = 0;
    this.att_scanner = scanner;
    }
int [] sync= new int[0];
  String att_code;
  VAR att_var;
  DTYPE att_type;
  TDS att_tds;
  TAM att_cpu;
  LEX_MJAVA att_scanner;
  LinkedList<TDS> att_tdsi;
  private void regle64() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    S_OPUN_MJAVA x_2 = new S_OPUN_MJAVA(scanner) ;
    S_F_MJAVA x_3 = new S_F_MJAVA(scanner) ;
    //appel
      action_auto_inh_64(x_2, x_3);
    x_2.analyser() ;
      addChild(x_2);
    x_3.analyser() ;
      addChild(x_3);
      action_code35_64(x_2, x_3);
     length =x_3.getOffset() + x_3.getLength()  -offset;
  }
  private void regle73() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    S_Q_MJAVA x_4 = new S_Q_MJAVA(scanner) ;
    //appel
      action_auto_inh_73(x_2, x_4);
    x_2.analyser(LEX_MJAVA.token_ident);
      addChild(x_2);
      action_var_73(x_2, x_4);
    x_4.analyser() ;
      addChild(x_4);
      action_code41_73(x_2, x_4);
     length =x_4.getOffset() + x_4.getLength()  -offset;
  }
  private void regle71() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    S_Q_MJAVA x_4 = new S_Q_MJAVA(scanner) ;
    //appel
      action_auto_inh_71(x_4);
    x_2.analyser(LEX_MJAVA.token_this);
      addChild(x_2);
      action_var_71(x_4);
    x_4.analyser() ;
      addChild(x_4);
      action_code39_71(x_4);
     length =x_4.getOffset() + x_4.getLength()  -offset;
  }
  private void regle62() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    //appel
    x_2.analyser(LEX_MJAVA.token_vrai);
      addChild(x_2);
      action_code33_62();
     length =x_2.getOffset() + x_2.getLength()  -offset;
  }
  private void regle69() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    S_E_MJAVA x_3 = new S_E_MJAVA(scanner) ;
    T_MJAVA x_4 = new T_MJAVA(scanner ) ;
    //appel
      action_auto_inh_69(x_3);
    x_2.analyser(LEX_MJAVA.token_paro);
      addChild(x_2);
    x_3.analyser() ;
      addChild(x_3);
    x_4.analyser(LEX_MJAVA.token_parf);
      addChild(x_4);
      action_code37_69(x_3);
     length =x_4.getOffset() + x_4.getLength()  -offset;
  }
  private void regle68() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    //appel
    x_2.analyser(LEX_MJAVA.token_nil);
      addChild(x_2);
      action_code36_68();
     length =x_2.getOffset() + x_2.getLength()  -offset;
  }
  private void regle72() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    S_Q_MJAVA x_4 = new S_Q_MJAVA(scanner) ;
    //appel
      action_auto_inh_72(x_4);
    x_2.analyser(LEX_MJAVA.token_super);
      addChild(x_2);
      action_var_72(x_4);
    x_4.analyser() ;
      addChild(x_4);
      action_code40_72(x_4);
     length =x_4.getOffset() + x_4.getLength()  -offset;
  }
  private void regle70() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    S_TYPE_MJAVA x_3 = new S_TYPE_MJAVA(scanner) ;
    T_MJAVA x_4 = new T_MJAVA(scanner ) ;
    S_ARGS_MJAVA x_5 = new S_ARGS_MJAVA(scanner) ;
    T_MJAVA x_6 = new T_MJAVA(scanner ) ;
    //appel
      action_auto_inh_70(x_3, x_5);
    x_2.analyser(LEX_MJAVA.token_nouveau);
      addChild(x_2);
    x_3.analyser() ;
      addChild(x_3);
    x_4.analyser(LEX_MJAVA.token_paro);
      addChild(x_4);
    x_5.analyser() ;
      addChild(x_5);
    x_6.analyser(LEX_MJAVA.token_parf);
      addChild(x_6);
      action_code38_70(x_3, x_5);
     length =x_6.getOffset() + x_6.getLength()  -offset;
  }
  private void regle61() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    //appel
    x_2.analyser(LEX_MJAVA.token_entier);
      addChild(x_2);
      action_code32_61(x_2);
     length =x_2.getOffset() + x_2.getLength()  -offset;
  }
  private void regle63() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    //appel
    x_2.analyser(LEX_MJAVA.token_faux);
      addChild(x_2);
      action_code34_63();
     length =x_2.getOffset() + x_2.getLength()  -offset;
  }
private void action_code40_72(S_Q_MJAVA x_4) throws Exception {
try {
// instructions
this.att_var=null;
this.att_code=x_4.att_code;
if (x_4.att_type.compareTo( new DTYPE("null", 0))){
this.att_type=this.att_tds.getTypeSuper();
}
else {
this.att_type=x_4.att_type;
}
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_var_72(S_Q_MJAVA x_4) throws Exception {
try {
// instructions
x_4.att_typh= new DTYPE("null", 0);
x_4.att_nom=null;
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_var_73(T_MJAVA x_2, S_Q_MJAVA x_4) throws Exception {
try {
// locales
INFO loc_i;
TDS loc_tdstemp;
String loc_nomtyp;
// instructions
x_4.att_nom=x_2.att_txt;
loc_tdstemp=this.att_tds.getParent();
loc_nomtyp=loc_tdstemp.getNom();
loc_i=this.att_tds.chercherGlobalement(loc_nomtyp);
x_4.att_typh=loc_i.getType();
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_auto_inh_71(S_Q_MJAVA x_4) throws Exception {
try {
// instructions
x_4.att_tds=this.att_tds;
x_4.att_tdsi=this.att_tdsi;
x_4.att_cpu=this.att_cpu;
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_code39_71(S_Q_MJAVA x_4) throws Exception {
try {
// instructions
this.att_var=null;
this.att_code=x_4.att_code;
if (x_4.att_type.compareTo( new DTYPE("null", 0))){
this.att_type=this.att_tds.getTypeThis();
}
else {
this.att_type=x_4.att_type;
}
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_code41_73(T_MJAVA x_2, S_Q_MJAVA x_4) throws Exception {
try {
// instructions
this.att_code="";
this.att_var=null;
this.att_type=x_4.att_type;
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_var_71(S_Q_MJAVA x_4) throws Exception {
try {
// instructions
x_4.att_typh= new DTYPE("null", 0);
x_4.att_nom=null;
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_code37_69(S_E_MJAVA x_3) throws Exception {
try {
// instructions
this.att_var=null;
this.att_code=x_3.att_code;
this.att_type=x_3.att_type;
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_code33_62() throws Exception {
try {
// instructions
this.att_var=null;
this.att_type= new DTYPE("boolean", 1);
this.att_code=this.att_cpu.chargerVrai();
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_auto_inh_72(S_Q_MJAVA x_4) throws Exception {
try {
// instructions
x_4.att_tds=this.att_tds;
x_4.att_tdsi=this.att_tdsi;
x_4.att_cpu=this.att_cpu;
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_auto_inh_69(S_E_MJAVA x_3) throws Exception {
try {
// instructions
x_3.att_tds=this.att_tds;
x_3.att_tdsi=this.att_tdsi;
x_3.att_cpu=this.att_cpu;
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_code38_70(S_TYPE_MJAVA x_3, S_ARGS_MJAVA x_5) throws Exception {
try {
// instructions
this.att_var=null;
this.att_type=x_3.att_type;
if (!(x_3.att_type.verifierArgs(x_5.att_typeargs, this.att_tds))){
att_scanner._interrompre(IProblem.Semantic, att_scanner.getBeginLine(), IMJAVAMessages.id_T_10, MJAVAMessages.T_10,new Object[]{});

}

this.att_code=x_5.att_code+this.att_cpu.appelConstructeur(x_3.att_type.getNom());
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_auto_inh_73(T_MJAVA x_2, S_Q_MJAVA x_4) throws Exception {
try {
// instructions
x_4.att_tds=this.att_tds;
x_4.att_tdsi=this.att_tdsi;
x_4.att_cpu=this.att_cpu;
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_code32_61(T_MJAVA x_2) throws Exception {
try {
// instructions
this.att_var=null;
this.att_type= new DTYPE("int", 1);
this.att_code=this.att_cpu.chargerEntier(x_2.att_txt);
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_code35_64(S_OPUN_MJAVA x_2, S_F_MJAVA x_3) throws Exception {
try {
// instructions
this.att_var=null;
this.att_code=x_3.att_code+this.att_cpu.genOPUN(x_2.att_operateur);
if (x_2.att_type.compareTo(x_3.att_type)){
this.att_type=x_2.att_type;
}
else {
att_scanner._interrompre(IProblem.Semantic, att_scanner.getBeginLine(), IMJAVAMessages.id_T_08, MJAVAMessages.T_08,new Object[]{""+x_2.att_type.getNom(), ""+x_3.att_type.getNom()});

}
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_code36_68() throws Exception {
try {
// instructions
this.att_var=null;
this.att_type= new DTYPE("null", 0);
this.att_code="";
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_code34_63() throws Exception {
try {
// instructions
this.att_var=null;
this.att_type= new DTYPE("boolean", 1);
this.att_code=this.att_cpu.chargerFaux();
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_auto_inh_64(S_OPUN_MJAVA x_2, S_F_MJAVA x_3) throws Exception {
try {
// instructions
x_3.att_tds=this.att_tds;
x_3.att_tdsi=this.att_tdsi;
x_3.att_cpu=this.att_cpu;
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_auto_inh_70(S_TYPE_MJAVA x_3, S_ARGS_MJAVA x_5) throws Exception {
try {
// instructions
x_3.att_tds=this.att_tds;
x_5.att_tds=this.att_tds;
x_3.att_tdsi=this.att_tdsi;
x_5.att_tdsi=this.att_tdsi;
x_5.att_cpu=this.att_cpu;
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
  public void analyser () throws Exception {
    scanner.lit ( 1 ) ;
    switch ( scanner.fenetre[0].code ) {
      case LEX_MJAVA.token_entier : // 45489
        regle61 () ;
      break ;
      case LEX_MJAVA.token_vrai : // 45485
        regle62 () ;
      break ;
      case LEX_MJAVA.token_faux : // 45486
        regle63 () ;
      break ;
      case LEX_MJAVA.token_plus : // 45477
        regle64 () ;
      break ;
      case LEX_MJAVA.token_moins : // 45478
        regle64 () ;
      break ;
      case LEX_MJAVA.token_non : // 45484
        regle64 () ;
      break ;
      case LEX_MJAVA.token_nil : // 45470
        regle68 () ;
      break ;
      case LEX_MJAVA.token_paro : // 45446
        regle69 () ;
      break ;
      case LEX_MJAVA.token_nouveau : // 45465
        regle70 () ;
      break ;
      case LEX_MJAVA.token_this : // 45487
        regle71 () ;
      break ;
      case LEX_MJAVA.token_super : // 45488
        regle72 () ;
      break ;
      case LEX_MJAVA.token_ident : // 45490
        regle73 () ;
      break ;
      default :
               scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[0].getNom()});
    }
  }
    private IDstNode parent;
    public void setParent( IDstNode p){parent = p;}
    public IDstNode getParent(){return parent;}
    private List<IDstNode> children = null ;
    public void addChild(IDstNode node){
      if (children == null) {
         children = new ArrayList<IDstNode>() ;}
      children.add(node);
      node.setParent(this);
    }
    public List<IDstNode> getChildren(){return children;}
    public boolean isLeaf(){return children == null;}
    public void accept(IDstVisitor visitor) {
      boolean visitChildren = visitor.visit(this);
      if (visitChildren && children != null){
        for(IDstNode node : children){
          node.accept(visitor);
        }
    }
    visitor.endVisit(this);
  }
  private int offset;
  private int length;
  public int getOffset(){return offset;}
  public void setOffset(int o){offset = o;}
  public int getLength(){return length;}
  public void setLength(int l){length = l;}
  private boolean malformed = false;
  public void setMalformed(){malformed = true;}
  public boolean isMalformed(){return malformed;}
  }
